package com.example.recruitment.mapper;

import com.example.recruitment.entity.Job;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface JobMapper {
    List<Job> findAll();
    
    List<Job> findAll(Job query);
    
    Job findById(Long id);
    
    List<Job> findByDepartment(String department);
    
    int insert(Job job);
    
    int update(Job job);
    
    int deleteById(Long id);
    
    int updateStatus(@Param("id") Long id, @Param("status") String status);
    
    long count();
    
    List<Job> findLatest(int limit);

    @Select("SELECT COUNT(*) FROM job WHERE status = #{status}")
    long countByStatus(@Param("status") String status);
} 